<template>
  <div class="binding">
    <div class="ele-title"><h3>老宝贝商户管理后台</h3></div>
    <div class="ele-content">
      <p class="tent-title">绑定手机号码</p>
      <div class="ele-input">
        <p class="userName">
          <span class="name-title">手机号码:</span><input
            v-model="form.phoneNumber"
            maxlength="11"
            type="text"
            name="userPh"
          >
        </p>
        <el-divider class="ele-hr" />
        <p class="name-regx">请输入正确的手机号</p>
      </div>
      <div class="ele-input">
        <p class="passWord">
          <span class="pwd-title">验证码:</span>
          <input v-model="form.VCode" type="password" name="YZM">
          <el-button
            v-if="isTrue"
            type="text"
            class="ele-yanz"
            @click="getYzhengma"
          >
            <span>获取验证码</span>
          </el-button>
          <el-button v-else type="text" class="ele-font">
            {{ tCont }}S后可重发验证码
          </el-button>
        </p>
        <el-divider class="ele-hr" />
        <p class="pwd-regx">请输入正确的验证码</p>
      </div>

      <p class="ele-bot-e">
        <span>未收到验证码？<el-button
          type="text"
        >点击使用语音验证码</el-button></span>
      </p>
      <div class="ele-btn">
        <el-button type="primary" @keydown.enter="getSubmit(form)" @click="getSubmit(form)">确定</el-button>
      </div>
    </div>
    <div class="ele-bottom">
      <pre>@ 2020-2021 互帮老宝贝 （苏州）科技优先公司</pre>
    </div>
  </div>
</template>

<script>
export default {
  name: 'BindingPhone',
  data() {
    return {
      tCont: 60,
      isTrue: true,
      form: {}
    }
  },
  methods: {
    /** 提交 */
    getSubmit() {},
    /** 获取验证码 */
    getYzhengma() {
      this.isTrue = false
      setInterval(() => {
        this.tCont--
      }, 1000)
    }
  }
}
</script>

<style lang="scss" scoped>
.binding {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  .el-divider--horizontal {
    margin: 0px;
  }
  .ele-title {
    width: 100%;
    padding-left: 10%;
    margin-top: 5%;
  }
  .ele-content {
    border: 1px solid #e6e6e6;
    width: 400px;
    height: 400px;
    margin-top: 100px;
    padding: 0px 40px;
    .ele-input{
      position: relative;
    }
    .ele-hr {
      margin-top: 10px;
    }
    p {
      margin: 0px;
    }
    .tent-title {
      font-size: 15px;
      font-weight: bold;
      margin: 30px 0px;
    }
    .userName,
    .passWord{
      margin-top: 50px;
      font-size: 0.7rem;
    }
    .ele-btn {
      margin-top: 30px;
      font-size: 0.7rem;
    }
    .userName {
      display: flex;
      align-items: center;
    }
    .passWord {
      display: flex;
      align-items: center;
      .pwd-title {
        width: 70px;
        text-align: end;
      }
      .ele-font {
        color: #dddddd;
      }
      .ele-font,
      .ele-yanz {
        width: 200px;
        text-align: end;
      }
    }
    .userName > input,
    .passWord > input {
      border: none;
      outline: none;
    }
    .ele-btn {
      width: 100%;
      .el-button--medium {
        width: 100% !important;
      }
    }
    .pwd-regx,
    .name-regx {
      position: absolute;
      color: red;
      font-size: 12px;
      margin-top: 10px;
    }
    .ele-bot-e {
      margin-top: 12px;
      display: flex;
      justify-content: flex-end;
      span,
      .el-button--medium {
        font-size: 12px;
      }
    }
  }
  .ele-bottom {
    font-size: 14px;
    color: gray;
    margin-top: 50px;
  }
}
</style>
